﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StatisticsLeft.aspx.cs"
	Inherits="HZ.Supervise.Web.PageControl.StatisticsLeft" %>

<%@ Register Src="../Common/WebUserArea.ascx" TagName="WebUserArea" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>
	<link rel="stylesheet" type="text/css" href="../Style/s-type.css" />

	<script src="../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

	<script src="../scripts/DynaForm.js" type="text/javascript"></script>

	<script src="../scripts/GenUtils.js" type="text/javascript"></script>

	<link type="text/css" rel="Stylesheet" href="../Style/style.css" />

	<script type="text/javascript">

		//医院
		function seturl1(sortname) {
			var hid1Str = document.getElementById("hid1").value.toString();

			if (hid1Str.substring(0, hid1Str.indexOf(',')) == "HospitalCheckPass" || hid1Str.substring(0, hid1Str.indexOf(',')) == "") {

				if (hid1Str.substring(hid1Str.indexOf(',') + 1, hid1Str.length).replace(" ", "") == "医院月报" || hid1Str.substring(0, hid1Str.indexOf(',')) == "") {

					CallFunc('../../Secondphase/Statistics/StatisticsHospitalByYear.aspx?Y=' + encodeURI(sortname), 'FORM', null, 'Main');
				}
				else if (hid1Str.substring(hid1Str.indexOf(',') + 1, hid1Str.length).replace(" ", "") == "医院季报") {

					CallFunc('../../Secondphase/Statistics/StatisticsHospitalBySeason.aspx?Y=' + encodeURI(sortname), 'FORM', null, 'Main');
				}

			}

		}

		function seturl(sessionid) {
			var hid3Str = document.getElementById("hid3").value.toString();

			if (hid3Str.substring(0, hid3Str.indexOf(',')) == "CompanyCheckPass" || hid3Str.substring(0, hid3Str.indexOf(',')) == "") {

				if (hid3Str.substring(hid3Str.indexOf(',') + 1, hid3Str.length).replace(" ", "") == "企业月报" || hid3Str.substring(0, hid3Str.indexOf(',')) == "") {

					CallFunc('../../Secondphase/Statistics/StatisticsCompanyByYear.aspx?' + sessionid, 'FORM', null, 'Main');
				}
				else if (hid3Str.substring(hid3Str.indexOf(',') + 1, hid3Str.length).replace(" ", "") == "企业季报") {

					CallFunc('../../Secondphase/Statistics/StatisticsCompanyBySeason.aspx?' + sessionid, 'FORM', null, 'Main');
				}
				else {
 
					return false;
				}
			}
		}

		//企业
		function seturl3(sortname) {
			var hid3Str = document.getElementById("hid3").value.toString();

			if (hid3Str.substring(0, hid3Str.indexOf(',')) == "CompanyCheckPass" || hid3Str.substring(0, hid3Str.indexOf(',')) == "") {

				if (hid3Str.substring(hid3Str.indexOf(',') + 1, hid3Str.length).replace(" ", "") == "企业月报" || hid3Str.substring(0, hid3Str.indexOf(',')) == "") {

					CallFunc('../../Secondphase/Statistics/StatisticsCompanyByYear.aspx?Y=' + encodeURI(sortname), 'FORM', null, 'Main');

				}
				else if (hid3Str.substring(hid3Str.indexOf(',') + 1, hid3Str.length).replace(" ", "") == "企业季报") {

					CallFunc('../../Secondphase/Statistics/StatisticsCompanyBySeason.aspx?Y=' + encodeURI(sortname), 'FORM', null, 'Main');
				}
				else {

					return false;
				}

			}

		}

		//地区
		function Button1_onclick() {
			var vareid;
			if ($("#WebUserArea1_ddlCountry").val() == "0" || $("#WebUserArea1_ddlCountry").val() == "") {
				//如果地市为全部  全省为全部 返回空
				if ($("#WebUserArea1_ddlCity").val() == "0" || $("#WebUserArea1_ddlCity").val() == "") {
					vareid = "";
				}
				//如果地市为全部  省市有值 返回空省市值
				else {
					vareid = $("#WebUserArea1_ddlCity").val();
				}
			} //如果地市有值 返回地市值
			else {
				vareid = $("#WebUserArea1_ddlCountry").val();
			}

			var hid2Str = document.getElementById("hid2").value.toString();

			if (hid2Str.substring(0, hid2Str.indexOf(',')) == "AreaCheckPass" || hid2Str.substring(0, hid2Str.indexOf(',')) == "") {

				if (hid2Str.substring(hid2Str.indexOf(',') + 1, hid2Str.length).replace(" ", "") == "地区月报" || hid2Str.substring(0, hid2Str.indexOf(',')) == "") {

					CallFunc('../../Secondphase/Statistics/StatisticsAeraByYear.aspx?Y=' + encodeURI(vareid), 'FORM', null, 'Main');


				}
				else if (hid2Str.substring(hid2Str.indexOf(',') + 1, hid2Str.length).replace(" ", "") == "地区季报") {

					CallFunc('../../Secondphase/Statistics/StatisticsAeraBySeason.aspx?Y=' + encodeURI(vareid), 'FORM', null, 'Main');
				}
				else {
					return false;
				}

			}
		}
		function show(id) {
			var name = id;
			document.getElementById("Hos").style.display = "none";
			document.getElementById("Hosshow").style.display = "none";
			document.getElementById("Com").style.display = "none";
			document.getElementById("Comshow").style.display = "none";
			document.getElementById("Area").style.display = "none";
			if (name == "Hos") {
				document.getElementById("Hos").style.display = "block";
				document.getElementById("Hosshow").style.display = "block";
			}
			if (name == "Com") {
				document.getElementById("Com").style.display = "block";
				document.getElementById("Comshow").style.display = "block";
			}
			if (name == "Area") {
				document.getElementById("Area").style.display = "block";
			}
		}
	</script>
	<script type="text/javascript">
    function a(gvd,obj,url) 
    {
        try {
            var o = document.getElementById(gvd);
            var a = o.getElementsByTagName('a');
            for (i = 0; i < a.length; i++) 
            {
                a[i].style.fontWeight = "normal";
            }
            obj.style.fontWeight = "bold";
            if(url!='')
            {
                if(gvd=='gvwHospitalName')
                    seturl1(url);
                else if(gvd=='gvwCompany')
                    seturl(url);
            }
        }
        catch(ex)
        {
            alert(ex);
        }
    }
</script>
</head>
<body>
	<form id="form1" runat="server">
	<div id="main">
		<div class="left">
			<div class="left1">
				<h1 class="leftTitle1">
					欢迎您！</h1>
				<ul>
					<li>
						<asp:Label ID="lblCurrentUser" runat="server" Text="Label"></asp:Label></li>
					<li>当前角色：
						<asp:Label ID="lblCurrentRole" runat="server" Text="Label"></asp:Label></li>
				</ul>
			</div>
			<div class="left2">
				<h1 class="leftTitle2">
					检索</h1>
				<table>
					<tr>
						<asp:HiddenField ID="link" runat="server" />
						<td>
							<a href="javascript:show('Hos')">医院</a> &nbsp;|&nbsp; <a href="javascript:show('Com')">
								企业</a> &nbsp;|&nbsp; <a href="javascript:show('Area')">地区</a>
						</td>
					</tr>
				</table>
			</div>
			<div class="left2" id="Hos" style="display: block">
				<table border="0" cellspacing="0" cellpadding="0" style="border-top: 100px">
					<tr>
						<td>
							<asp:Label ID="lbname" runat="server" Text="医院名称："></asp:Label>
						</td>
						<td>
							<asp:TextBox ID="txtHosName" runat="server" Height="19px" Width="95px" CssClass="souSuo"></asp:TextBox>
						</td>
						<td style="padding-left: 4px; padding-right: 0px">
							<asp:ImageButton ID="benQuaryHos" runat="server" OnClick="benQuaryHos_Click" ImageUrl="~/Images/ModalImageAh_New/souSuoBtn.png"
								ToolTip="点击查询符合条件的数据" />
						</td>
					</tr>
				</table>
			</div>
			<div class="left3" style="height: 309px; display: block" id="Hosshow">
				<asp:GridView ID="gvwHospitalName" runat="server" AutoGenerateColumns="False" CssClass="mainlist"
					Width="100%" EmptyDataText="无符合条件的数据！" OnRowDataBound="gvwHospitalName_RowDataBound">
					<Columns>
						<%--<asp:TemplateField HeaderText="医院列表">
							<ItemTemplate>
								<a style="cursor: hand" href='javascript:seturl1("<%# Eval("HospitalID") %>")'>&nbsp;&nbsp;<%# Eval("HospitalName")%></a>
							</ItemTemplate>
							<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
						</asp:TemplateField>--%>
				     <%-- <asp:BoundField DataField="HospitalID" HeaderText="医院编号" ItemStyle-HorizontalAlign="Left" Visible="false" />--%>
					  <asp:BoundField DataField="HospitalName" HeaderText="医院列表" ItemStyle-HorizontalAlign="Left" />
					</Columns>
				</asp:GridView>
				<webdiyer:AspNetPager ID="AspNetPager1" runat="server" CustomInfoHTML="" CustomInfoStyle="display:none"
					NumericButtonCount="3" OnPageChanged="AspNetPager1_PageChanged" ReverseUrlPageIndex="false"
					ShowDisabledButtons="False" ShowFirstLast="False" ShowMoreButtons="true" ShowPageSizeBox="false"
					ShowPrevNext="False" PageSize="8" LayoutType="Table">
				</webdiyer:AspNetPager>
			</div>
			<div class="left2" id="Com" style="display: none">
				<ul>
					<li>
						<asp:RadioButtonList ID="rblcompanytype" runat="server" RepeatDirection="Horizontal"
							CellPadding="1" CellSpacing="1" AutoPostBack="True" OnSelectedIndexChanged="rblcompanytype_SelectedIndexChanged"
							Height="28px" Width="154px">
							<asp:ListItem Value="0" Text="生产企业"></asp:ListItem>
							<asp:ListItem Value="2" Text="配送企业" Selected="True"></asp:ListItem>
						</asp:RadioButtonList>
					</li>
					<li>
						<asp:TextBox ID="txtname" runat="server" CssClass="souSuo" Height="19px" Width="132px"></asp:TextBox>
						<asp:ImageButton ID="btnQueryCom" ImageAlign="Right" runat="server" OnClick="btnQueryCom_Click"
							ImageUrl="~/Images/ModalImageAh_New/souSuoBtn.png" ToolTip="点击查询符合条件的数据" />
					</li>
				</ul>
			</div>
			<div class="left3" style="display: none; height: 278px" id="Comshow">
				<asp:GridView ID="gvwCompany" runat="server" AutoGenerateColumns="False" CssClass="mainlist"
					Width="100%" EmptyDataText="无符合条件的数据！" OnRowDataBound="gvwCompany_RowDataBound">
					<Columns>
					
						<asp:BoundField DataField="CompanyName" HeaderText="企业列表" ItemStyle-HorizontalAlign="Left" />
					</Columns>
				</asp:GridView>
				
				<webdiyer:AspNetPager ID="AspNetPager2" runat="server" CustomInfoHTML="" CustomInfoStyle="display:none"
					NumericButtonCount="3" ReverseUrlPageIndex="false" OnPageChanged="AspNetPager2_PageChanged"
					ShowDisabledButtons="False" ShowFirstLast="False" ShowMoreButtons="true" ShowPageSizeBox="false"
					ShowPrevNext="False" PageSize="8" LayoutType="Table">
				</webdiyer:AspNetPager>
			</div>
			<div style="display: none; height: 342px" id="Area" class="left3">
				<table>
					<tr>
						<td>
							<uc2:WebUserArea ID="WebUserArea1" runat="server" />
						</td>
					</tr>
					<tr>
						<td align="right">
							<input id="Button2" type="button" value="查  询" class="btn" style="margin-top: 1px"
								onclick="return Button1_onclick()" />
						</td>
					</tr>
				</table>
			</div>
			<input type="hidden" id="hid1" value='<%=CheckMenuByUserID("医院") %> ' />
			<input type="hidden" id="hid2" value='<%=CheckMenuByUserID("地区") %> ' />
			<input type="hidden" id="hid3" value='<%=CheckMenuByUserID("企业") %> ' />
		</div>
	</div>
	</form>
</body>
</html>
